<template>
	<view>
		<u-navbar title="完拼队列" :fixed="true" :placeholder="true" :safeAreaInsetTop="true" :autoBack="false"
			leftIconColor="#666" titleStyle="color:#333" bgColor="#10191F" :rightText="righttext" @rightClick="right"
			@leftClick="leftClick"></u-navbar>
		<view class="main">
			<view class="tit">
				<text class="text1" >完拼卡编号</text>
				<text class="text2" >用户</text>
				<!-- <text class="text3" >购车基金贡献额</text> -->
			</view>
			<view class="wrap">


	
				<view class="item" v-for="item in selllist" :key="item.id" >
				<view class="lefts">
					<text class="num" >{{item.goods_number}}</text>
					<text v-if="item.status==6" class="tag" >已提车</text>
				</view>
					<view class="center">
						<image :src="item.head_img" mode="aspectFill"></image>
						<view class="centertop">
							<text class="name" >{{item.nickname}}</text>
							<text class="time" >{{item.create_time}}</text>
						</view>
					</view>
					<!-- <view class="price">
						￥{{item.contribution_total}}
					</view> -->
				</view>
				<noDatas :xxxList="selllist" :type="2" :showMore="false"></noDatas>
			</view>
			
		</view>
		<view class="empty3">
			
		</view>

	</view>
</template>

<script>
	import {deliveryQueue,wpindex}from  "../../api/mycar.js"
	export default {
		data() {
			return {
				page: 1,
				size: 20,
				selnum: "",
				status: 'loadmore', //加载前值为loadmore，加载中为loading，没有数据为nomore
				selllist:[],
				selfitem:{},
				righttext:"显示我的",
				is_have:0
			}
		},
		onLoad() {
			this.getselllist()
		},
		methods: {
			leftClick() {
				//获取页面栈的长度
				const canNavBack = getCurrentPages()
				console.log(canNavBack.length);
				// 判断是否刷新了浏览器，刷新了浏览器，页面栈只有当前一个
				if (canNavBack.length > 1) {
					uni.navigateBack({
						delta: 1
					})
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					})
				}
			},
		right(){
			this.is_have=!this.is_have
			if(this.is_have==true){
				this.is_have=1
				this.righttext="全部"
			}
			if(this.is_have==false){
							this.is_have=0
							this.righttext="显示我的"
						}
			
			this.page=1
			this.getselllist()
		},
		getselllist() {
			wpindex({
				page: this.page,
				is_have:this.is_have
			}).then(res => {
				if (res.code == 1) {
					this.selfitem=res.data.self
					let list = res.data.data;
					this.selllist = this.page == 1 ? list : this.selllist.concat(list);
					// console.log(this.goodlist2);
					if (list.length < this.size) this.status = 'nomore';
					else this.status = 'loading';	
				}
		
			})
		},
		},
		onReachBottom() {
			if (this.status != 'nomore') {
				this.page = this.page + 1
				this.getselllist()
			}
		},
	}
</script>
<style>
	page{
		background: #10191F !important;
	}
</style>
<style scoped lang="scss">
	@font-face {
		font-family: 'iconfont2';
		src: url("~@/iconfont/YouSheBiaoTiHei.ttf");
	}
/deep/ .u-navbar__content__title{
	color: #fff !important;
}
/deep/.uicon-arrow-left{
	color: #fff !important;
}
/deep/.u-navbar__content__right__text{
	color: #fff !important;
}
.main{
	width: 690rpx;
	// height: 1162rpx;
	padding-bottom: 40rpx;
	box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
	border-radius: 0rpx 0rpx 0rpx 0rpx;
	margin:  0 auto;
	.tit{
		display: flex;
		align-items: center;
		justify-content: space-around;
		padding-top: 40rpx;
		.text1{
			// margin-right: 150rpx;
			font-weight: 500;
			font-size: 32rpx;
			color: rgba(255,255,255,0.8);
		}
		.text2{
			font-weight: 500;
			font-size: 32rpx;
			margin-right: 160rpx;
			color: rgba(255,255,255,0.8);
		}
		.text3{
			margin-right: 40rpx;
			font-weight: 500;
			font-size: 32rpx;
			color: rgba(255,255,255,0.8);
		}
	}
		
	.wrap{
		margin-top: 40rpx;
		.item{
			width: 690rpx;
			display: flex;
			align-items: center;
			margin-top: 40rpx;
			.img{
				width: 75rpx;
				height: 75rpx;
				margin-left: 90rpx;
			}
			.lefts{
				width: 100rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				margin-left: 86rpx;
				.tag{
					width: 88rpx;
					height: 42rpx;
					box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
					font-weight: 400;
					font-size: 22rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 42rpx;
				}
				.num{
					width: 100rpx;
					height: 75rpx;
					text-align: center;
					line-height: 75rpx;
					font-weight: 500;
					font-size: 30rpx;
					color: #FFFFFF;
				}
			}
			
			.center{
				display: flex;
				margin-left:100rpx;
				>image{
					width: 86rpx;
					height: 86rpx;
					border-radius: 50%;
				}
				.centertop{
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					margin-left: 10rpx;
					.name{
						width: 200rpx;
						font-weight: 500;
						font-size: 32rpx;
						color: #FFFFFF;
						 white-space: nowrap; /* 防止文本换行 */
						  overflow: hidden; /* 隐藏溢出部分 */
						  text-overflow: ellipsis; /* 显示省略号 */
					}
					.time{
						font-weight: 400;
						font-size: 24rpx;
						color: rgba(255,255,255,0.8);
					}
				}
				
			}
			.price{
				text-align: right;
				font-weight: 400;
				font-size: 36rpx;
				color: #FFFFFF;
				font-family: iconfont2;
			}
		}
	}
}
.mine{
	width: 750rpx;
	height: 200rpx;
	margin: 0 auto;
	position: fixed;
	bottom: 0rpx;
	left: 50%;
	transform: translate(-50%);
	background: #10191F;
	z-index: 9;
		.item{
			position: fixed;
			bottom: 50rpx;
			left: 50%;
			transform: translate(-50%);
			width: 690rpx;
			height: 112rpx;
			box-shadow: inset 0rpx 0rpx 20rpx 0rpx #1C85DB;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
			width: 690rpx;
			display: flex;
			align-items: center;
			margin: 0 auto;
			margin-top: 10rpx;
			.img{
				width: 75rpx;
				height: 75rpx;
				margin-left: 20rpx;
			}
			.num{
				width: 75rpx;
				height: 75rpx;
				text-align: center;
				line-height: 75rpx;
				font-weight: 500;
				font-size: 40rpx;
				color: #FFFFFF;
				margin-left: 86rpx;
			}
			.center{
				display: flex;
				margin-left: 100rpx;
				>image{
					width: 86rpx;
					height: 86rpx;
					border-radius: 50%;
				}
				.centertop{
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					margin-left: 10rpx;
					.name{
						width: 200rpx;
						font-weight: 500;
						font-size: 32rpx;
						color: #FFFFFF;
						 white-space: nowrap; /* 防止文本换行 */
						  overflow: hidden; /* 隐藏溢出部分 */
						  text-overflow: ellipsis; /* 显示省略号 */
					}
					.time{
						font-weight: 400;
						font-size: 24rpx;
						color: rgba(255,255,255,0.8);
					}
				}
				
			}
			.price{
				text-align: right;
				font-weight: 400;
				font-size: 36rpx;
				color: #FFFFFF;
				font-family: iconfont2;
			}
		}
}
</style>